/*
 * Copyright (c) 2021. Moses All Right Reserved
 */

package com.moses.design_patterns.bride;

/**
 * @author Moses
 * @email shenhuohui@gmail.com
 * @date 2021/4/17 10:37
 */
public class Son extends AbstractFather {

    public Son(Implementor implementor) {
        super(implementor);
    }

    @Override
    public void stableMethod1() {
        System.out.println("this is stable method1 in Son");
    }

    @Override
    public void stableMethod2() {
        System.out.println("this is stable method2 in Son");
        System.out.println("i will use transient method2 in Son");
        // 子类中使用易变方法
        needTransientMethod2();
    }

    private void needTransientMethod2(){
        getImplementor().transientMethod2();
    }
}
